Summary of FileSwitch SWIs


OS_Byte:

  127 - EOF status for open file
  139 - performs *OPT
  255 - read/set auto-boot setting


OS_File:

  0,10         - save
  1,2,3,4,9,18 - write catalogue information
  5,13,15,17   - read catalogue information
  6            - delete
  7,11         - create empty file
  8            - create directory
  12,14,16,255 - load
  19           - generate error message
  20,21,22,23  - read catalogue information
  24           - read block size


OS_Args:

  0   - read temporary filing system number or read sequential pointer
  1   - write sequential pointer
  2   - read extent
  3   - write extent
  4   - read allocated size
  5   - read EOF status
  6   - ensure file's allocation
  7   - find canonical name of open file
  8   - inform of change of image stamp
  254 - read information about open file
  255 - flush file(s)


OS_BGet - read a byte
OS_BPut - write a byte


OS_GBPB:

  1,2        - write bytes
  3,4        - read bytes
  5,6,7      - read information on filing system
  8          - read object names from current directory
  9,10,11,12 - read entries from directory


OS_Find:

  0      - close
  64-255 - open


OS_FSControl:

  0     - set CSD and filing system
  1     - set library directory
  2     - prepare to start new application
  4     - run a file
  5,7   - catalogue a directory
  6,8,9 - examine a directory
  10    - set filing system options (*OPT)
  11    - set temporary filing system from named prefix
  12    - add a filing system
  13    - check presence of filing system
  14    - select filing system
  15    - boot from filing system
  16    - remove filing system
  17    - add a secondary module
  18    - translate file type into text
  19    - restore current filing system
  20    - locate temporary filing system's primary module
  21    - return internal file handle
  22    - close all files
  23    - shutdown filing systems
  24    - set access rights
  25    - rename object
  26    - copy objects
  27    - wipe objects
  28    - count objects
  30    - locate temporary filing system's secondary module
  31    - convert textual file type to number
  32    - *FileInfo
  33    - convert filing system number to name
  35    - add image filing system
  36    - remove image filing system
  37    - convert path name to canonicalised name
  38    - convert file information to file type
  39    - set URD
  40    - exchange current and previous directories
  41    - read defect list for image
  42    - map out defect in image
  43    - unset CSD
  44    - unset URD
  45    - unset library directory
  46    - return image file's used space map
  47    - read boot option
  48    - write boot option
  49    - read free space
  50    - name disc
  51    - request image stamp update
  52    - find usage of offset in image
  53    - set special directory to specified path (no check)
  54    - read path for special directory


*****************************************************************************

OS_Byte 127 - EOF status for open file

  R0  127
  R1  file handle       0 iff EOF

OS_Byte 139 - performs *OPT

  R0  139
  R1  option number (eg 4, as in *OPT 4,1)
  R2  option value  (eg 1, as in *OPT 4,1)

OS_Byte 255 - read/set auto-boot setting

  R0  255
  R1  0 or new value    previous value
  R2  &ff or 0

*****************************************************************************

OS_File 0,10 - save

  R0  0 or 10
  R1  file name
  R2  load (0)  or  file type (10)
  R3  exec (0)
  R4  start address
  R5  end address + 1

OS_File 1,2,3,4,9,18 - write catalogue information

  R0  1(load,exec,attr),2(load),3(exec),4(attr),9(stamp) or 18(filetype)
  R1  object name
  R2  load (1,2) or file type (18)
  R3  exec (1,3)
  R5  attributes (1,4)

OS_File 5,13,15,17 - read catalogue information

  R0  5(File$Path),13(path),15(path variable) or 17(none)     object type
  R1  object name
  R2                                                          load
  R3                                                          exec
  R4  path (13) or path variable (15)                         length
  R5                                                          attributes

OS_File 6 - delete

  R0  6               object type
  R1  object name
  R2                  load
  R3                  exec
  R4                  length
  R5                  attributes

OS_File 7,11 - create empty file

  R0  7 or 11
  R1  file name
  R2  load (7) or file type (11)
  R3  exec (7)
  R4  start address
  R5  end address + 1

OS_File 8 - create directory

  R0  8
  R1  dir name
  R4  number of entries

OS_File 12,14,16,255 - load

  R0  12(path),14(path var),16(none) or 255(File$Path)      object type
  R1  file name
  R2  load address, if bottom byte of R3 non-zero           load
  R3  see R2                                                exec
  R4  path (12) or path var (14)                            length
  R5                                                        attributes

OS_File 19 - generate error message

  R0  19                                 pointer to error block
  R1  object name
  R2  object type (0, 1, 2 or &100)

OS_File 20,21,22,23 - read catalogue information

  R0  20(File$Path),21(path),22(path var) or 23(none)       object type
  R1  object name
  R2                                                        load/hi-datestamp
  R3                                                        exec/lo-datestamp
  R4  path(21) or path var(22)                              length
  R5                                                        attributes
  R6                                                        file type

OS_File 24 - read block size

  R0  24
  R1  file name
  R2                        natural block size

*****************************************************************************

OS_Args 0 - read temporary filing system number(A) or 
            read sequential pointer(B)

  R0  0                            temporary filing system number(A)
  R1  0(A) or file handle(B)
  R2                               sequential pointer(B)

OS_Args 1 - write sequential pointer

  R0  1
  R1  file handle
  R2  sequential pointer

OS_Args 2 - read extent

  R0  2
  R1  file handle
  R2                       extent

OS_Args 3 - write extent

  R0  3
  R1  file handle
  R2  extent

OS_Args 4 - read allocated size

  R0  4
  R1  file handle
  R2                       allocation

OS_Args 5 - read EOF status

  R0  5
  R1  file handle
  R2                       0 iff EOF

OS_Args 6 - ensure file's allocation

  R0  6
  R1  file handle
  R2  allocation request     allocation granted

OS_Args 7 - find canonical name of open file

  R0  7
  R1  file handle
  R2  buffer
  R5  buffer size            spare bytes in buffer - may be less than zero

OS_Args 8 - inform of change of image stamp

  R0  8
  R1  file handle
  R2  new image-stamp value

OS_Args 254 - read information about open file

  R0  9                      stream status word
  R1  file handle
  R2                         filing sytem information word

OS_Args 255 - flush file(s)

  R0  255
  R1  file handle or 0 (to flush all files on the temporary filing system)

*****************************************************************************

OS_BGet - read a byte

  R0                         byte read
  R1  file handle

OS_BPut - write a byte

  R0  byte
  R1  file handle

*****************************************************************************

OS_GBPB 1,2 - write bytes

  R0  1,2
  R1  file handle
  R2  buffer                         updated
  R3  number of bytes to write       updated (ie 0)
  R4  sequential pointer(1)          sequential pointer

OS_GBPB 3,4 - read bytes

  R0  3,4
  R1  file handle
  R2  buffer                         updated
  R3  number of bytes to read        updated
  R4  sequential pointer(3)          sequential pointer

OS_GBPB 5,6,7 - read information on filing system

  R0  5(disc name),6(CSD) or 7(library directory)
  R2  buffer

OS_GBPB 8 - read object names from current directory

  R0  8
  R2  buffer
  R3  number of names to read        updated
  R4  first one to read              updated

OS_GBPB 9,10,11,12 - read entries from directory

  R0  9(names),10(standard-2.00),11(+datastamp) or 12(standard-3.00)
  R1  dir name
  R2  buffer
  R3  number of entries to read      updated 
  R4  first one to read              updated
  R5  buffer length
  R6  wild-carded name to match

*****************************************************************************

OS_Find 0 - close

  R0  0
  R1  file handle or 0(close all files on current filing system)

OS_Find 64-255 - open

  R0  &4x(read),&8x(new) or &Cx(update)      file handle or 0(not found)
  R1  file name
  R2  path or path var

*****************************************************************************

OS_FSControl 0 - set CSD and filing system

  R0  0
  R1  dir name

OS_FSControl 1 - set library directory

  R0  1
  R1  dir name

OS_FSControl 2 - prepare to start new application   [??]

  R0  2
  R1  command tail
  R2  currently active object pointer
  R3  command name

OS_FSControl 4 - run a file

  R0  4
  R1  file name

OS_FSControl 5,7 - catalogue a directory

  R0  5(relative to CSD) or 7(relative to library directory)
  R1  dir name

OS_FSControl 6,8,9 - examine a directory

  R0  6(relative to CSD),8(relative to library directory) or 9
  R1  dir name

OS_FSControl 10 - set filing system options (*OPT)

  R0  10
  R1  option (0, 1 or 4)
  R2  option parameter

OS_FSControl 11 - set temporary filing system from named prefix

  R0  11
  R1  string       updated
  R2               previous filing system or -1 (no filing system name found)
  R3               special field or 0 (if none present)

OS_FSControl 12 - add a filing system

  R0  12
  R1  module base address
  R2  filing system information block offset
  R3  private word pointer

OS_FSControl 13 - check presence of filing system

  R0  13
  R1  fs number or fs name                fs number
  R2  poss. terminators for fs name       fs control block or 0 (not found)

OS_FSControl 14 - select filing system

  R0  14
  R1  fs number or fs name

OS_FSControl 15 - boot from filing system

  R0  15

OS_FSControl 16 - remove filing system

  R0  16
  R1  fs name

OS_FSControl 17 - add a secondary module   [??]

  R0  17
  R1  fs name
  R2  secondary module name
  R3  secondary module workspace pointer

OS_FSControl 18 - translate file type into text

  R0  18
  R1  file type
  R2                     first four chars
  R3                     second four chars

OS_FSControl 19 - restore current filing system

  R0  19

OS_FSControl 20 - locate temporary filing system's primary module

  R0  20
  R1            module base address
  R2            module's private word pointer

OS_FSControl 21 - return internal file handle

  R0  21
  R1  file handle        corresponding handle as used by filing system
  R2                     filing system information word

OS_FSControl 22 - close all files

  R0  22

OS_FSControl 23 - shutdown filing systems

  R0  23

OS_FSControl 24 - set access rights

  R0  24
  R1  object name
  R2  attribute string

OS_FSControl 25 - rename object

  R0  25
  R1  object name
  R2  new name

OS_FSControl 26 - copy objects

  R0  26
  R1  source path name
  R2  destination path name
  R3  flags to describe action
  R4  optional start time (low bytes)
  R5  optional start time (high byte)
  R6  optional end time (low bytes)
  R7  optional end time (high byte)
  R8  optional pointer to extra information descriptor

OS_FSControl 27 - wipe objects

  R0  27
  R1  path name
  R3  flags to describe action
  R4  optional start time (low bytes)
  R5  optional start time (high byte)
  R6  optional end time (low bytes)
  R7  optional end time (high byte)

OS_FSControl 28 - count objects

  R0  27
  R1  path name
  R2                                      number of bytes counted
  R3  flags to describe action            number of files counted
  R4  optional start time (low bytes)
  R5  optional start time (high byte)
  R6  optional end time (low bytes)
  R7  optional end time (high byte)

OS_FSControl 30 - locate temporary filing system's secondary module

  R0  30
  R1                 module base address
  R2                 temporary filing system's private word pointer

OS_FSControl 31 - convert textual file type to number

  R0  31
  R1  string
  R2                 file type

OS_FSControl 32 - *FileInfo

  R0  32
  R1  path name

OS_FSControl 33 - convert filing system number to name

  R0  33
  R1  filing system number
  R2  buffer
  R3  buffer length

OS_FSControl 35 - add image filing system

  R0  35
  R1  module base address
  R2  image filing system information block offset
  R3  private word pointer

OS_FSControl 36 - remove image filing system

  R0  36
  R1  image filing system's image file type

OS_FSControl 37 - convert path name to canonicalised name

  R0  37
  R1  path name
  R2  buffer
  R3  optional path variable
  R4  optional path string
  R5  buffer size                updated (<=0 => buffer too small)

OS_FSControl 38 - convert file information to file type

  R0  38
  R1  object name
  R2  load                     object file type(-1, &1000, &2000 as special)
  R3  exec
  R4  length
  R5  attributes
  R6  object type (1,2,3)

OS_FSControl 39 - set URD

  R0  39
  R1  dir name

OS_FSControl 40 - exchange current and previous directories

  R0  40

OS_FSControl 41 - read defect list for image

  R0  41
  R1  image file name
  R2  buffer
  R3  buffer length

OS_FSControl 42 - map out defect in image

  R0  42
  R1  image file name
  R2  offset of defect

OS_FSControl 43 - unset CSD

  R0  43

OS_FSControl 44 - unset URD

  R0  44

OS_FSControl 45 - unset library directory

  R0  45

OS_FSControl 46 - return image file's used space map

  R0  46
  R1  image file name
  R2  buffer
  R3  buffer length

OS_FSControl 47 - read boot option

  R0  47
  R1  name of object on disc/image
  R2                                        boot option

OS_FSControl 48 - write boot option

  R0  48
  R1  name of object on disc/image
  R2  boot option

OS_FSControl 49 - read free space

  R0  49                                    free space
  R1  name of object on disc/image          largest creatable object
  R2                                        disc size

OS_FSControl 50 - name disc

  R0  50
  R1  name of object on disc/image
  R2  image name

OS_FSControl 51 - request image stamp update

  R0  51
  R1  name of object on disc/image
  R2  0(stamp on update) or 1(stamp now)

OS_FSControl 52 - find usage of offset in image

  R0  52
  R1  name of object on disc/image
  R2  offset                            kind of object found
  R3  buffer
  R4  buffer length

OS_FSControl 53 - set special directory to specified path (no check)

  R0  53
  R1  path
  R2  directory to set (@,\,& or %)
  R3  filing system name
  R6  special field or 0

OS_FSControl 54 - read path for special directory

  R0  54
  R1  buffer                                path (or 0 if unset)
  R2  directory to set (@,\,& or %)
  R3  filing sytem name
  R5  buffer size (or 0 to determine size)  updated
  R6                                        special field or 0

*****************************************************************************
